@extends('mobile.layout1')
@section('title','收益')
@section('css')
    <link rel="stylesheet" href="{{asset('FENXIAO/js/dropload-gh-pages/dist/dropload.css')}}">
@endsection

@section('aside-bar')

@endsection
@section('content')
<body>
<div class="view-container mgn55">
    <div class="view-inner">
        <div class="tab-nav order-nav-tab">
            <a @if(route('myTeam.profit',['type'=>$type])==\Illuminate\Support\Facades\Request::fullUrl()) class="active" @endif href="{{route('myTeam.profit',['type'=>$type])}}">全部</a>
            <a @if(route('myTeam.profit',['type'=>$type,'money'=>'used'])==\Illuminate\Support\Facades\Request::fullUrl()) class="active" @endif href="{{route('myTeam.profit',['type'=>$type,'money'=>'used'])}}" >已结算</a>
            <a @if(route('myTeam.profit',['type'=>$type,'money'=>'noUsed'])==\Illuminate\Support\Facades\Request::fullUrl()) class="active" @endif href="{{route('myTeam.profit',['type'=>$type,'money'=>'noUsed'])}}" >未结算</a>
        </div>
        <div class="order-list-container">
            <ul class="js-order-list">

            </ul>
            <div class="jiazai"></div>
            <div class="order-total">金额总计：{{$totalMoney}}</div>
        </div>
    </div>
</div>
</body>
</html>
    @endsection
@section('js')
    <script type="text/javascript" src="{{asset('FENXIAO/js/dropload-gh-pages/dist/dropload.js')}}"></script>

    <script>


        $(function(){
            var tab1LoadEnd = false;

            // tab
            var page = 1;
                    @if(route('myTeam.profit',['type'=>$type])==\Illuminate\Support\Facades\Request::fullUrl())

            var url='{!! route('myTeam.ajaxProfit',['type'=>$type])!!}';
                    @elseif(route('myTeam.profit',['type'=>$type,'money'=>'used'])==\Illuminate\Support\Facades\Request::fullUrl())
            var url='{!!route('myTeam.ajaxProfit',['type'=>$type,'money'=>'used'])!!}';
                    @elseif(route('myTeam.profit',['type'=>$type,'money'=>'noUsed'])==\Illuminate\Support\Facades\Request::fullUrl())
            var url='{!! route('myTeam.ajaxProfit',['type'=>$type,'money'=>'noUsed'])!!}';
            @endif
            // dropload
            var dropload = $('.jiazai').dropload({
                scrollArea : window,
                loadDownFn : function(me){
                    // 加载菜单一的数据

                    $.ajax({
                        type: 'GET',
                        url: url,
                        data:{page:page},
                        dataType: 'text',
                        success: function(data){
                            var result = '';
                            page++;

                            if(data==''){
                                // 数据加载完
                                tab1LoadEnd = true;
                                // 锁定
                                me.lock();
                                // 无数据
                                me.noData();
                            }
                            $('.js-order-list').append(data);
                            me.resetload();
                        },
                        error: function(xhr, type){
                            //alert('Ajax error!');
                            // 即使加载出错，也得重置
                            me.resetload();
                        }
                    });
                    // 加载菜单二的数据

                }
            });
        });
    </script>
    @endsection
